var input = document.querySelector('.container input');

//函数防抖
function debounce(fn, delay) {
  var timerId;
  return function () {
    clearTimeout(timerId);
    var curThis=this;
    timerId = setTimeout(() => {
      fn.apply(curThis,arguments);
    }, delay);
  };
}

var newHandler = debounce(function (e) {
  console.log('输入', this.value,e);
}, 1000);
input.addEventListener('change', newHandler);
